# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=qimgv
pkgver=1.0.2
pkgrel=3
pkgdesc="Cross-platform image viewer with webm support"
url="https://github.com/easymodo/qimgv"
options="!check"
arch="all"
license="GPL-3.0-or-later"
depends="hicolor-icon-theme"
makedepends="
	cmake
	exiv2-dev
	mpv-dev
	qt6-qt5compat-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	samurai
	"
subpackages="$pkgname-mpv"
source="$pkgname-$pkgver.tar.gz::https://github.com/easymodo/qimgv/archive/v$pkgver.tar.gz
	exiv2-0.28.patch
	mpv-2.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DEXIV2=ON \
		-DVIDEO_SUPPORT=ON \
		-DOPENCV_SUPPORT=OFF \
		-DKDE_SUPPORT=OFF
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

mpv() {
	pkgdesc="$pkgdesc (mpv support)"
	install_if="$pkgname=$pkgver-r$pkgrel mpv-libs"

	amove usr/lib/qimgv/player_mpv.so
}

sha512sums="
3e10a87f28f7187251c93c92b418ee34e4c2b373b0dd957604fd46305237dc52fd7e17880507b3a0d757c0c3800e8185b6085f15f6f05db6d29cae1e67044b58  qimgv-1.0.2.tar.gz
f5c1e8d007f523fbf78a51e0e98f7a074761e7e6bb1b7394e1fbccfb5c81bf960a6a39b89da303d9e8f528067da03a0d73032d2c623e44efae94d9470fde4da0  exiv2-0.28.patch
314b78881a333ad1747bbe7e2c411f5066af41f5b1532e19b3a895be55023fbd6d44af0df86974e294029c53be98404e22009e2c604dfb6ff57171b07f9019aa  mpv-2.patch
"
